  

import { axios } from '@/service/service'
import { ListReq, QueueReq, IdReq } from './types'

// 新增或修改queue 
export function addOrUpdate(params: any): any {
  return axios({
    url: '/api-scheduler/queue/addOrUpdate',
    method: 'get',
    params
  })
}

// 查询queue列表
export function findQueues(params: any): any {
  return axios({
    url: '/api-scheduler/queue/findQueues',
    method: 'get',
    params
  })
}

// del queue列表
export function delQueue(params: any): any {
  return axios({
    url: '/api-scheduler/queue/delQueue',
    method: 'get',
    params
  })
}

// 获取queue所有项目
export function getPros(params: any): any {
  return axios({
    url: '/api-scheduler/queue/getPros',
    method: 'get',
    params
  })
}

// 配置 项目
export function setPros(params: any): any {
  return axios({
    url: '/api-scheduler/queue/setPros',
    method: 'get',
    params
  })
}


// -------------------  分割线  --------------------------

export function queryQueueListPaging(params: ListReq): any {
  return axios({
    url: '/queues',
    method: 'get',
    params
  })
}

export function createQueue(data: QueueReq): any {
  return axios({
    url: '/queues',
    method: 'post',
    data
  })
}

export function queryList(): any {
  return axios({
    url: '/queues/list',
    method: 'get'
  })
}

export function verifyQueue(data: QueueReq): any {
  return axios({
    url: '/queues/verify',
    method: 'post',
    data
  })
}

export function updateQueue(data: QueueReq, idReq: IdReq): any {
  return axios({
    url: `/queues/${idReq.id}`,
    method: 'put',
    data
  })
}
